Algebraic operations are implemented as friends due to the binary nature of the operators. Note that these operators will work with vector (and affine vector) equivalence class arguments. This is included for completeness; the randomization that occurs in mappings from vector (and affine vector) equivalence classes makes it unlikely that this feature will be useful.
friend GeOb operator-(GeOb& th)
If the object is a vector or affine vector, this negates it. Otherwise, it is mapped into a vector in the linearization space (or into a tangent space vector, if it is an affine vector equivalence class) prior to negation.
friend GeOb operator+(GeOb& th, GeOb& g) friend GeOb operator-(GeOb& th, GeOb& g)
If the objects are vectors or affine vectors in the same space, these operators add or subtract them. Otherwise, the objects are first mapped into vectors in the linearization space (or into tangent space vectors, if the operation involves just affine vector equivalence classes and/or affine vectors).
friend GeOb operator*(GeOb& th, GeOb& g)
This operation of scalar multiplication is only legal if one of the geometric objects is a vector in the space ``Reals''. If the other object is not a vector or affine vector, it is first mapped into a vector in the linearization space (or into a tangent space vector, if it is an affine vector equivalence class) before the scalar multiplication is carried out.
friend GeOb operator/(GeOb& th, GeOb& g)
Just like the scalar multiplication operation described above, except that the second operand g is required to be a nonzero vector in the space ``Reals''.
Scalar Apply(GeOb& a)
Treat this GeOb as a linear functional and apply it to the object a in its dual space. One of the objects must be in either the linearization dual space or tangent dual space (if that object is a vector equivalence class, it is mapped to a vector in the space). The other object is first mapped, if necessary, to a vector or affine vector in the corresponding primal space.
GeOb Dual(void)
If this GeOb is a vector or affine vector, return the dual vector. Otherwise, it is mapped into a vector in the linearization space (or into a tangent space vector, if it is an affine vector equivalence class) prior to taking the dual. Only valid if the space is Euclidean.
Apply the standard mappings to this GeOb to convert it to a GeOb of type t, if possible.
GeOb SetTupleElement(int n, GeOb& g)
If this GeOb is not a vector, affine vector, or affine point, it is first mapped to a vector. This function returns a tuple that has the nth element of this tuple changed to g, using zero-based indexing. The object g is first mapped into the corresponding space component of the cartesian product space, if necessary.
friend PPoint CrossRatio(AugScalar v, GeObList& g)
The list g must consist of three objects that can be cast into collinear points in the projective completion space. Given the list of points
(A, B, C), and the cross ratio v = (A, B;C, D), this routine returns the projective point D.
friend AugScalar CrossRatioCalc(GeObList& g)
The list g must consist of four objects that can be cast into collinear points in the projective completion space, where at least three are distinct. Given the list of points (A, B, C, D), this function returns the cross ratio (A, B;C, D).